{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "只想用vscode以jupyterNotebook的形式学习.net知识，不想安装其它太多的东西。\n",
    "1. 安装vscode\n",
    "2. .NET 7 开发工具包https://dotnet.microsoft.com/en-us/download\n",
    "3. 安装python\n",
    "4. 安装Jupyter的内核，用于在Vs Code中运行ipynb文件\n",
    "```\n",
    "pip install ipykernel \n",
    "```\n",
    "或安装jupyter\n",
    "```\n",
    "pip install 安装Jupyter notebook\n",
    "```\n",
    "运行以下命令来验证安装，以确保 Jupyter 和 .NET 已安装并存在于路径上：\n",
    "```\n",
    "> jupyter kernelspec list\n",
    "  python3        ~\\jupyter\\kernels\\python3\n",
    "> dotnet --version\n",
    "  6.0.100\n",
    "```\n",
    "5. 安装全局工具：dotnet interactive\n",
    "```\n",
    "> dotnet interactive jupyter install\n",
    "Installing using jupyter kernelspec module.\n",
    "Installed \".NET (C#)\" kernel.\n",
    "Installing using jupyter kernelspec module.\n",
    "Installed \".NET (F#)\" kernel.\n",
    "Installing using jupyter kernelspec module.\n",
    "Installed \".NET (PowerShell)\" kernel.\n",
    "```\n",
    "6. 安装jupyter 的.NET 内核\n",
    "```\n",
    "dotnet interactive jupyter install\n",
    "```\n",
    "再次运行以下命令来验证安装。现在，应会看到每种默认支持的 .NET 语言的条目：kernelspec\n",
    "```\n",
    "> jupyter kernelspec list\n",
    "  .net-csharp        ~\\jupyter\\kernels\\.net-csharp\n",
    "  .net-fsharp        ~\\jupyter\\kernels\\.net-fsharp\n",
    "  .net-powershell    ~\\jupyter\\kernels\\.net-powershell\n",
    "  python3            ~\\jupyter\\kernels\\python3\n",
    "```\n",
    "7. 更新 .NET Interactive\n",
    "```\n",
    "> dotnet tool update -g Microsoft.dotnet-interactive\n",
    "```\n",
    "8. 安装装vs扩展包\n",
    ">  Polyglot Notebooks\n",
    "\n",
    "9. 完成最后几个准备步骤后，VS Code 就可以使用 Jupyter Notebook 了。\n",
    "创建 Jupyter 笔记本\n",
    "点击 View -> Command Palette (如果使用的是 Mac, 可以用⇧⌘P 来快速打开) 就可以创建一个新的 Jupyter 笔记本。下个页面弹出之后，搜索「Jupyter」并选择「Python: Create Blank New Jupyter Notebook」选项，就可以创建一个新的 Notebook 了。\n",
    "创建文件成功后，根据vs提示安装其它扩展包"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://github.com/dotnet/interactive/blob/main/docs/NotebookswithJupyter.md#updating-net-interactive\n",
    "\n",
    "https://www.cnblogs.com/jason-wei/articles/15517594.html\n",
    "\n",
    "https://cloud.tencent.com/developer/article/1520882#:~:text=%E5%9B%BD%E5%86%85%E7%9A%84pip%E6%BA%90%201%20%E9%98%BF%E9%87%8C%E4%BA%91%EF%BC%9A%20https%3A%2F%2Fmirrors.aliyun.com%2Fpypi%2Fsimple%2F%202%20%E6%B8%85%E5%8D%8E%EF%BC%9A%20https%3A%2F%2Fpypi.tuna.tsinghua.edu.cn%2Fsimple%203,%E5%8D%8E%E4%B8%AD%E7%90%86%E5%B7%A5%E5%A4%A7%E5%AD%A6%EF%BC%9A%20http%3A%2F%2Fpypi.hustunique.com%2F%205%20%E5%B1%B1%E4%B8%9C%E7%90%86%E5%B7%A5%E5%A4%A7%E5%AD%A6%EF%BC%9A%20http%3A%2F%2Fpypi.sdutlinux.org%2F%206%20%E8%B1%86%E7%93%A3%EF%BC%9A%20http%3A%2F%2Fpypi.douban.com%2Fsimple%2F\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "输入 python -m ensurepip\n",
    "P.S.:ensurepip的文档网址：https://www.osgeo.cn/cpython/library/ensurepip.html\n",
    "\n",
    "更新pip python -m pip install --upgrade pip"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 配置中科大镜像\n",
    "pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple\n",
    "\n",
    "# 配置阿里源\n",
    "pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/\n",
    "# 配置腾讯源\n",
    "pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple\n",
    "# 配置豆瓣源\n",
    "pip config set global.index-url http://pypi.douban.com/simple/\n",
    "\n",
    "## 你只需配置其中一个即可\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[global]\n",
    "index-url = http://mirrors.cloud.tencent.com/pypi/simple\n",
    "trusted-host = mirrors.cloud.tencent.com\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".NET (C#)",
   "language": "C#",
   "name": ".net-csharp"
  },
  "language_info": {
   "name": "C#",
   "version": "3.10.10"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "40ea231ce006ed65b013ba3e9b5a48267321b4d32b910ea3a649228a606377c3"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
